# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.DocumentAI.V1beta3.Model.GoogleCloudDocumentaiV1beta3Evaluation do
  @moduledoc """
  An evaluation of a ProcessorVersion's performance.

  ## Attributes

  *   `allEntitiesMetrics` (*type:* `GoogleApi.DocumentAI.V1beta3.Model.GoogleCloudDocumentaiV1beta3EvaluationMultiConfidenceMetrics.t`, *default:* `nil`) - Metrics for all the entities in aggregate.
  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - The time that the evaluation was created.
  *   `documentCounters` (*type:* `GoogleApi.DocumentAI.V1beta3.Model.GoogleCloudDocumentaiV1beta3EvaluationCounters.t`, *default:* `nil`) - Counters for the documents used in the evaluation.
  *   `entityMetrics` (*type:* `%{optional(String.t) => GoogleApi.DocumentAI.V1beta3.Model.GoogleCloudDocumentaiV1beta3EvaluationMultiConfidenceMetrics.t}`, *default:* `nil`) - Metrics across confidence levels, for different entities.
  *   `kmsKeyName` (*type:* `String.t`, *default:* `nil`) - The KMS key name used for encryption.
  *   `kmsKeyVersionName` (*type:* `String.t`, *default:* `nil`) - The KMS key version with which data is encrypted.
  *   `name` (*type:* `String.t`, *default:* `nil`) - The resource name of the evaluation. Format: `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}`
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :allEntitiesMetrics =>
            GoogleApi.DocumentAI.V1beta3.Model.GoogleCloudDocumentaiV1beta3EvaluationMultiConfidenceMetrics.t()
            | nil,
          :createTime => DateTime.t() | nil,
          :documentCounters =>
            GoogleApi.DocumentAI.V1beta3.Model.GoogleCloudDocumentaiV1beta3EvaluationCounters.t()
            | nil,
          :entityMetrics =>
            %{
              optional(String.t()) =>
                GoogleApi.DocumentAI.V1beta3.Model.GoogleCloudDocumentaiV1beta3EvaluationMultiConfidenceMetrics.t()
            }
            | nil,
          :kmsKeyName => String.t() | nil,
          :kmsKeyVersionName => String.t() | nil,
          :name => String.t() | nil
        }

  field(:allEntitiesMetrics,
    as:
      GoogleApi.DocumentAI.V1beta3.Model.GoogleCloudDocumentaiV1beta3EvaluationMultiConfidenceMetrics
  )

  field(:createTime, as: DateTime)

  field(:documentCounters,
    as: GoogleApi.DocumentAI.V1beta3.Model.GoogleCloudDocumentaiV1beta3EvaluationCounters
  )

  field(:entityMetrics,
    as:
      GoogleApi.DocumentAI.V1beta3.Model.GoogleCloudDocumentaiV1beta3EvaluationMultiConfidenceMetrics,
    type: :map
  )

  field(:kmsKeyName)
  field(:kmsKeyVersionName)
  field(:name)
end

defimpl Poison.Decoder,
  for: GoogleApi.DocumentAI.V1beta3.Model.GoogleCloudDocumentaiV1beta3Evaluation do
  def decode(value, options) do
    GoogleApi.DocumentAI.V1beta3.Model.GoogleCloudDocumentaiV1beta3Evaluation.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.DocumentAI.V1beta3.Model.GoogleCloudDocumentaiV1beta3Evaluation do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
